<%@ page contentType="text/html; charset=utf-8" language="java" import="java.util.*,com.course.domain.*" errorPage="" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
	Map scoreMap = (Map)request.getAttribute("scoreMap");
	Student stu = null;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>Home Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="../css/adminStyle.css" type="text/css" />
<script language="javascript" src="../js/main.js" charset="utf-8"></script>
<script language="JavaScript" src="/course/js/validation-framework.js"></script>	
<script language="JavaScript" type="text/javascript">
//--------------- LOCALIZEABLE GLOBALS ---------------
var d=new Date();
var monthname=new Array("1","2","3","4","5","6","7","8","9","10","11","12");
//Ensure correct for language. English is "January 1, 2004"
var TODAY = d.getFullYear() + "年" + monthname[d.getMonth()] + "月" + d.getDate() + "日";
//---------------   END LOCALIZEABLE   ---------------
</script>
<style type="text/css">
<!--
.STYLE5 {color: #666666}
-->
</style>
</head>
<body bgcolor="#F4FFE4">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr bgcolor="#D5EDB3">
    <td colspan="3" rowspan="2"><img src="../image/mm_health_photo.jpg" alt="Header image" width="382" height="101" border="0" /></td>
    <td height="50" colspan="3" id="logo" valign="bottom" align="center" nowrap="nowrap">内蒙古工业大学</td>
    <td width="368">&nbsp;</td>
  </tr>

  <tr bgcolor="#D5EDB3">
    <td height="51" colspan="3" id="tagline" valign="top" align="center">成绩管理系统</td>
	<td width="368">&nbsp;</td>
  </tr>

  <tr>
    <td colspan="7" bgcolor="#5C743D"><img src="../image/mm_spacer.gif" alt="" width="1" height="2" border="0" /></td>
  </tr>

  <tr>
    <td colspan="7" bgcolor="#99CC66" background="../image/mm_dashed_line.gif"><img src="../image/mm_dashed_line.gif" alt="line decor" width="4" height="3" border="0" /></td>
  </tr>

  <tr bgcolor="#99CC66">
  	<td colspan="7" id="dateformat" height="20">&nbsp;&nbsp;<script language="JavaScript" type="text/javascript">
      document.write(TODAY);	</script>	
  	  教师：${loginedUser.name } 您好！ 欢迎使用成绩管理系统</td>
  </tr>
  <tr>
    <td colspan="7" bgcolor="#99CC66" background="../image/mm_dashed_line.gif"><img src="../image/mm_dashed_line.gif" alt="line decor" width="4" height="3" border="0" /></td>
  </tr>

  <tr>
    <td colspan="7" bgcolor="#5C743D"><img src="../image/mm_spacer.gif" alt="" width="1" height="2" border="0" /></td>
  </tr>

 <tr>
    <td width="165" valign="top" bgcolor="#5C743D">
	<table border="0" cellspacing="0" cellpadding="0" width="165" id="navigation">
        <tr>
          <td width="165">&nbsp;<br />
		 &nbsp;<br /></td>
        </tr>
		<tr>
          <td width="165"><a href="<%=basePath %>teacher/index.do" class="navText">管理首页</a></td>
        </tr>
        <tr>
          <td width="165"><a href="<%=basePath %>teacher/showInfo.do" class="navText">基本信息</a></td>
        </tr>
        <tr>
          <td width="165"><a href="<%=basePath %>teacher/showCourse.do" class="navText">课程查询</a></td>
        </tr>
        <tr>
          <td width="165"><a href="<%=basePath %>teacher/changePassword.do" class="navText">修改密码</a></td>
        </tr>
        <tr>
          <td width="165"><a href="<%=basePath %>logout.do" class="navText">退出登录</a></td>
        </tr>
      </table>
  <br />
  	&nbsp;<br />
  	&nbsp;<br />
  	&nbsp;<br /> 	</td>
    <td colspan="6" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>&nbsp;</td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td>课程名： ${course.name } | 可选状态：<c:if test="${!course.chooseStatus}">不</c:if>可选 | 结课状态： <c:if test="${course.finish}">
              		已结课
              	</c:if>
              	<c:if test="${!course.finish}">
           		未结课              	</c:if></td>
          </tr>
          <tr>
            <td><div align="right">
            <c:if test="${!course.chooseStatus && !course.finish}">
	            <a href="<%=basePath %>teacher/importResult.do?method=downExcel&courseId=${course.id}">下载成绩预录表格</a>
	            <a href="<%=basePath %>teacher/importResult.do?method=show&courseId=${course.id}">导入成绩</a>            </c:if>
            <c:if test="${course.finish}">
            	<a href="<%=basePath %>teacher/importResult.do?method=outResult&courseId=${course.id}">导出成绩</a>            </c:if>
            </div></td>
          </tr>
        </table></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td><div align="center">
          <table width="100%" border="1" cellspacing="0" cellpadding="0">
          <form id="showCourseInfo" name="showCourseInfo" method="get" action="changeScore.do" onsubmit="return ajaxSubmitForm(this);">
            <tr>
              <td>学号</td>
              <td>姓名</td>
              <td>班级</td>
              <td>成绩</td>
            </tr>
            <input name="courseId" id="courseId" value="${course.id}" type="hidden"/>
            <c:forEach items="${stuCours}" var="sc">
            <tr>
              <td>${sc[1] }                
               <input name="students" type="checkbox" disabled="disabled" id="students" style="display:none" value="${sc[0]}" checked="checked" /></td>
              <td>${sc[2] }</td>
              <td>${sc[3] }</td>
              
              	<td id="t${sc[0]}">
                <c:if test="${!course.chooseStatus && !course.finish}">
                	<input id="${sc[0]}" name="${sc[0]}" value="${sc[4] }" />
              	</c:if>
                  <c:if test="${ course.chooseStatus || course.finish}">
                    ${sc[4] }                  </c:if>              </td>
            </tr>
            </c:forEach>
            <tr>
            	<td colspan="4">
                	<div align="center">
            	  <c:if test="${page==1}">
                  <input type="button" value="首页" disabled="disabled" />
            	  
                  <input type="button" name="button4" id="button4" value="上一页" disabled="disabled" />
                  </c:if>
                  <c:if test="${page!=1}">
                  <input type="button" value="首页" onclick="javascript:window.open('<%=basePath%>teacher/showCourseInfo.do?page=1&courseId=${course.id}','_self')" />
            	  
                  <input type="button" name="button4" id="button4" value="上一页"  onclick="javascript:window.open('<%=basePath%>teacher/showCourseInfo.do?page=${page-1}&courseId=${course.id}','_self')" />
                  </c:if>
                  第<c:out value="${page}"/>/<c:out value="${pageCount}"/>页
                  <c:if test="${page==pageCount}">
            	  <input type="button" value="下一页" disabled="disabled" />
            	  
                  <input type="button" value="尾页" disabled="disabled" />
                  </c:if>
                    <c:if test="${page!=pageCount}">
            	  <input type="button" value="下一页"  onclick="javascript:window.open('<%=basePath%>teacher/showCourseInfo.do?page=${page+1}&courseId=${course.id}','_self')"/>
            	  
                  <input type="button" value="尾页"  onclick="javascript:window.open('<%=basePath%>teacher/showCourseInfo.do?page=${pageCount}&courseId=${course.id}','_self')"/>
                  </c:if>
                  &nbsp;&nbsp;&nbsp;&nbsp;
                   <c:if test="${!course.chooseStatus && !course.finish}">
                   <input type="submit" name="button" id="button" value="保存成绩" />
                   <input type="button" name="button2" id="button2" value="发布成绩" onclick="javascript:window.open('<%=basePath %>teacher/publishCourse.do?courseId=${course.id}','_self')" />
                   </c:if>
                  </div>                </td>
            </tr>
            </form>
          </table>
          
        </div></td>
        <td>&nbsp;</td>
      </tr>
     
    </table></td>
  </tr>
  <tr>
    <td width="165">&nbsp;</td>
    <td width="359">&nbsp;</td>
    <td width="158">&nbsp;</td>
    <td width="154">&nbsp;</td>
    <td width="20">&nbsp;</td>
    <td width="78">&nbsp;</td>
	<td width="368">&nbsp;</td>
  </tr>
</table>
</body>
</html>
